////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file   CollabRCBotUnitTests\MockDiff.h
///
/// @brief  Mock implementation of a CollabRC::Bot::Diff
////////////////////////////////////////////////////////////////////////////////////////////////////
#include "../CollabRCBot/Diff.h"
#include <vector>
#include "../CollabRCBot/WordSet.h"
#include "../CollabRCBot/DiffLine.h"

class MockDiff : public CollabRC::Bot::Diff
{
private:
    CollabRC::Bot::WordSet &m_added, &m_removed;
    std::vector<CollabRC::Bot::DiffLine> m_lines;
public:
    inline MockDiff(CollabRC::Bot::WordSet& added, CollabRC::Bot::WordSet& removed):m_added(added),m_removed(removed) { }

    inline const CollabRC::Bot::WordSet& GetAddedWords() const
    {
        return m_added;
    }

    inline const CollabRC::Bot::WordSet& GetRemovedWords() const
    {
        return m_removed;
    }

    inline unsigned int GetNumLines() const 
    {
        return m_lines.size();
    }

    inline const CollabRC::Bot::DiffLine& GetLine(unsigned int n) const 
    {
        if (m_lines.size() <= n)
        {
            CollabRC::Bot::IndexOutOfRangeException ex;
            throw ex;
        }
        else 
        {
            return m_lines[n];
        }
    }

    inline void AddLine(const CollabRC::Bot::DiffLine& line)
    {
        m_lines.push_back(line);
    }
};